package com.jimmy.tx.service.impl;

import com.jimmy.tx.dao.LogDao;
import com.jimmy.tx.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @version 1.0
 * @ ClassName LogServiceImpl
 * <p> TODO
 * @ author 王志明
 * @ Date 2020/11/9 10:04
 */
@Service("logService")
public class LogServiceImpl implements LogService {
    @Autowired
    private LogDao logDao;
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    // * 事务嵌套可参考 https://blog.csdn.net/qq_35830949/article/details/79581198
    public void insertLog(int type, String content) {
        logDao.insertLog(type,content);
    }
}
